package de.koller.worlders.engine.tiles.data;

import de.koller.worlders.WorldersRoot;
import de.koller.worlders.engine.tiles.Tile;

public class TileWrap {

	private final WorldersRoot wroot;
	private Tile tile;

	public String assignedKey = "";
	private long lastUse = -1;

	public TileWrap( TileLoader loader, int tx, int ty ) {
		this.wroot = loader.wroot;
		tile = loader.load( tx, ty );
	}
	
	public Tile getTile() {
		return tile;
	}
	
	public void releaseWrap() {
		if( tile != null )
			tile.ungenerate();
	}
	
	public long getLastUse() {
		return lastUse;
	}

	public void setLastUse() {
		lastUse = wroot.getTime();
	}
	
}
